/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

/**
 *
 * Misplaced Entity Exception
 * 
 * This exception is called when an entity is placed in an incorrect
 * or incompatible position within the context of the environment.
 * 
 * @author timon
 */
public class RH_MisplacedEntity extends Exception {
    
    /**
     * CONSTRUCTOR
     * 
     * This default constructor presents a default message when presenting
     * this exception to the debugger.
     */
    public RH_MisplacedEntity() {
        
        // Call the parent constructor with a default message.
        super("The placement of an Entity object was rejected by the " + 
                "environment.");
    }
    
    
    
    /**
     * CONSTRUCTOR 
     * 
     * This constructor override passes the message back to the parent class.
     * 
     * @param message 
     *   The message to be displayed in the presentation of the exception.
     */
    public RH_MisplacedEntity(String message) {
        
        // Call the parent constructor with paramater.
        super(message);
    }    
    
    /**
     * CONSTRUCTOR 
     * 
     * This constructor accepts context parameters to more concisely report
     * the nature of the exception.
     * 
     * @param subject
     *   This is the object being rejected by the environment.
     * @param environment
     *   This is the object representing the rejecting environment.
     */
    public RH_MisplacedEntity(Object subject, Object environment) {
        
        // Call the parent constructor with paramater.
        super("The " + subject.toString() + " object was rejected in the " +
                environment.toString() + " environment.");
    }    
}
